package com.whjz.dcfs.ssjk.struts.action;

import com.whjz.dcfs.jzxx.dao.IDcfsHjjcdJbxxDAO;
import com.whjz.dcfs.jzxx.model.DcfsHjjcdJbxx;
import com.whjz.dcfs.ssjk.dao.IDcfsHsEmstimeDAO;
import com.whjz.dcfs.ssjk.model.*;
import com.whjz.dcfs.util.BaseAction;
import com.whjz.dcfs.util.DateUtils;
import com.whjz.dcfs.util.JsonUtils;
import com.whjz.dcfs.util.UserUtil;
import com.whjz.dcfs.util.enums.BdzShiFanEnum;
import com.whjz.dcfs.util.excel.ExcelExporterUtils;
import com.whjz.dcfs.util.excel.QueryResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.*;

public class HsEmstimeAction extends BaseAction{

	private static final long serialVersionUID = 1L;

	@Autowired
	public IDcfsHjjcdJbxxDAO dcfsHjjcdJbxxDAO;
	@Autowired
	public IDcfsHsEmstimeDAO dcfsHsEmstimeDAO;
	private DcfsHjjcdJbxx dcfsHjjcdJbxx;
	private DcfsHsEmstime dcfsHsEmstime;
	private String chartJson;
	private String flag;//1为查询区域，2为查询站点
	private String time;
	private String type;//示范站点日统计，变电站类型(用来区分是哪个变电站)
	private int dataType;//下载数据类型 1分钟均值数据 2日均值数据
	private String downloadBdzCode;
	private String downloadBeginDay;
	private String downloadEndDay;

	public void getDcfsHjjcdJbxxListByCond() throws Exception{
		String xzqh=UserUtil.findUserFromSession(getSession().get("user"),"getConcern");
		if(xzqh.indexOf("区")!=-1){
			dcfsHjjcdJbxx=new DcfsHjjcdJbxx();
			dcfsHjjcdJbxx.setHjzljkxzqh(xzqh);
		}
		List<HashMap> list=dcfsHjjcdJbxxDAO.findXzqy(dcfsHjjcdJbxx);
		getHttpServletResponse().setCharacterEncoding("utf-8");
		StringBuffer sb=new StringBuffer();
		sb.append("[{");
		sb.append("\"id\":\"test\",");
		sb.append("\"text\":\"监测站点\",");
		sb.append("\"cls\":\"folder\",");
		sb.append("\"expanded\":true,");
		sb.append("\"children\":[");
		if(list.size()>0){
			for (int m=0;m<list.size();m++) {
				sb.append("{");
				sb.append("\"text\":\""+list.get(m).get("xzqh")+"("+list.get(m).get("num")+")"+"\",");
				dcfsHjjcdJbxx=new DcfsHjjcdJbxx(); 
				dcfsHjjcdJbxx.setHjzljkxzqh(list.get(m).get("xzqh").toString());
				List<DcfsHjjcdJbxx> listall=dcfsHjjcdJbxxDAO.getDcfsHjjcdJbxxListByCond(dcfsHjjcdJbxx);
//				String mns="";
//				for (DcfsHjjcdJbxx dcfsHjjcdJbxx : listall) {
//					mns=mns+","+dcfsHjjcdJbxx.getJkxtmn();
//				}
				sb.append("\"id\":\""+list.get(m).get("xzqh").toString()+"\",");
				sb.append("\"cls\":\"folder\",");
				sb.append("\"expanded\":false,");
				sb.append("\"children\":[");
				int j=1;
				if(listall!=null&&listall.size()>0){
					for(int i=0;i<listall.size();i++){
						sb.append("{");
						sb.append("\"text\":\""+(listall.get(i).getJcdmc()==null?"":listall.get(i).getJcdmc())+"\",");
						sb.append("\"id\":\""+(listall.get(i).getJkxtmn()==null?"":listall.get(i).getJkxtmn())+"\",");
						sb.append("\"leaf\":true");
						if(j<listall.size()){
							sb.append("},");
						}else{
							sb.append("}]");
						}
						j++;
				}
				}
				if(m<(list.size()-1)){
					sb.append("},");
				}else{
					sb.append("}");
				}
			}
		}
		sb.append("]}]");
		getHttpServletResponse().getWriter().println(sb);
	}
	
	public void getDcfsHsEmstimeListByCond() throws Exception{
		List<DcfsHsEmstime> list;
//		SimpleDateFormat formatS=new SimpleDateFormat("yyyyMMddhhmmss");
//		SimpleDateFormat formatD=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		if("1".equals(flag)){
//			String mns=dcfsHjjcdJbxx.getJkxtmn().substring(1, dcfsHjjcdJbxx.getJkxtmn().length());
//			String[] MnStr=mns.split(",");
			list=dcfsHsEmstimeDAO.getDcfsHsEmstimeListByCondNew(dcfsHjjcdJbxx.getJkxtmn().toString());
		}else{
			list=dcfsHsEmstimeDAO.getDcfsHsEmstimeListByCond(dcfsHsEmstime);
		}
		StringBuffer sb=new StringBuffer();
		sb.append("{root:[");
		if(list!=null&&list.size()>0){
			for(int i=0;i<list.size();i++){
				sb.append("{");
				sb.append("Jcd_mc:'"+list.get(i).getJcdmc()+"',");
				sb.append("JKXT_MN:'"+list.get(i).getJkxtmn()+"',");
				sb.append("Datatime:'"+list.get(i).getDatatime()+"',");
				if(list.get(i).getAvalue()==null){
					sb.append("Avalue:'"+list.get(i).getAvalue()+"',");
				}else{
					sb.append("Avalue:'"+Double.valueOf(list.get(i).getAvalue())+"',");
				}
				sb.append("Flag:'"+list.get(i).getFlag()+"',");
				sb.append("DataState:'"+list.get(i).getDatastate()+"'");
				sb.append("}");
				if(i < list.size()-1){
					sb.append(",");
				}
			}
		}
	    sb.append("]}");
//	    System.out.println("sb---"+sb);
	    getHttpServletResponse().setCharacterEncoding("utf-8");
	    getHttpServletResponse().setContentType("text/html:utf-8");
	    getHttpServletResponse().getWriter().print(sb);
	}
	
	public String chart() throws Exception{
		List<DcfsHsEmstime> list=dcfsHsEmstimeDAO.getDcfsHsEmstimeListByCond(dcfsHsEmstime);
//		SimpleDateFormat formatS=new SimpleDateFormat("yyyyMMddhhmmss");
//		SimpleDateFormat formatD=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		chartJson="[";
		for(int i=0;i<list.size();i++){
			chartJson+="{\"Datatime\":\""+list.get(i).getDatatime()+"\",";
			chartJson+="\"数值\":"+list.get(i).getAvalue();
			if(i==(list.size()-1)){
				chartJson+="}]";
			}else{
				chartJson+="},";
			}
		}
//		String xml="<chart><series xid=\"1\">";
//		int i=0;
//		for (Iterator iterator2 = list.iterator(); iterator2.hasNext();) {
//			DcfsHsEmstime he = (DcfsHsEmstime) iterator2.next();
//			xml +="<value xid=\""+i+"\">"+he.getDatatime()+"</value>";
//			i++;
//		}
//		xml+="</series><graphs><graph gid=\"1\">";
//		int j=0;
//		for (Iterator iterator2 = list.iterator(); iterator2.hasNext();) {
//			DcfsHsEmstime he = (DcfsHsEmstime) iterator2.next();
//			xml+="<value xid=\""+j+"\">"+he.getAvalue()+"</value>";
//			j++;
//		}
//		 
//		xml+="</graph></graphs></chart>";
//		System.out.println("---------------------"+chart);
//	    getHttpServletResponse().getWriter().print(xml);
		return "chart";
	}

	//示范站点实时数据
	public void getsssjByCond() throws Exception{
		HashMap map=new HashMap<>();
		map.put("code", "JZ-WH-112");
		List<DcfsData> list=dcfsHsEmstimeDAO.getsssjByCond(map);
		StringBuffer sb=new StringBuffer();
		sb.append("{root:[");
		if(list!=null&&list.size()>0){
			for(int i=0;i<list.size();i++){
				sb.append("{");
				sb.append("stCode:'"+list.get(i).getStCode()+"',");
				sb.append("value1:'"+list.get(i).getValue1()+"',");
				sb.append("value2:'"+list.get(i).getValue2()+"',");
				sb.append("value3:'"+list.get(i).getValue3()+"',");
				sb.append("value4:'"+list.get(i).getValue4()+"',");
				sb.append("dataTime:'"+list.get(i).getDataTime()+"',");
				sb.append("batteryVoltage:'"+list.get(i).getBatteryVoltage()+"',");
				sb.append("temperature:'"+list.get(i).getTemperature()+"',");
				sb.append("relativeHumidity:'"+list.get(i).getRelativeHumidity()+"',");
				sb.append("state:'"+list.get(i).getState()+"'");
				sb.append("}");
				if(i < list.size()-1){
					sb.append(",");
				}
			}
		}
	    sb.append("]}");
	    getHttpServletResponse().setCharacterEncoding("utf-8");
	    getHttpServletResponse().setContentType("text/html:utf-8");
	    getHttpServletResponse().getWriter().print(sb);
	}

	//示范点实时图
	public void getsssjData() throws Exception{
		HashMap map=new HashMap<>();
		List<DcfsData> list=dcfsHsEmstimeDAO.getsssjByCond(map);
	    String str = getData(list);
	    getHttpServletResponse().setCharacterEncoding("utf-8");
	    getHttpServletResponse().setContentType("text/html:utf-8");
	    getHttpServletResponse().getWriter().print(str);
	}

	//示范站点日统计
	public void getStatisticsDay() throws Exception{
		HashMap map=new HashMap();
		//String type = getHttpServletRequest().getParameter("type");
		if("1".equals(type)){
			map.put("code", "02715071015_ESM100");
		} else if("2".equals(type)){
			map.put("code", "02715071016_ESM100");
		} else if("3".equals(type)){
			map.put("code", "02715071017_ESM100");
		} else {
			map.put("code", "13MT0227");
		}
		int days = 0;
		if(StringUtils.isBlank(time)){
			//如果前台传过来的时间为空，设置当天时间
			Date d = new Date();
			time = DateUtils.formatDate(d);
			SimpleDateFormat sdf = new SimpleDateFormat("HH");
			days = Integer.parseInt(sdf.format(d));
		} else {
			Date d = new Date();
			String today = DateUtils.formatDate(d);
			if(today.equals(time)) {
				SimpleDateFormat sdf = new SimpleDateFormat("HH");
				days = Integer.parseInt(sdf.format(d));
			} else {
				days = 24;
			}
		}
		map.put("startTime", time+" 00:00:00");
		map.put("endTime", time+" 23:59:59");
		List<BdzData> list = dcfsHsEmstimeDAO.getToday(map);
		/*List<BdzData> full = new ArrayList<BdzData>();
		String yesterday = null;
		if(list == null || list.size() == 0) {
			Date day = time == null ? new Date() :  new SimpleDateFormat("yyyy-MM-dd").parse(time);
			yesterday = DateUtils.formatDate(DateUtils.amount(day,Calendar.DAY_OF_YEAR,-1));

			HashMap map1=new HashMap();
			map1.put("code",map.get("code"));
			map1.put("startTime", yesterday+" 00:00:00");
			map1.put("endTime", yesterday+" 23:59:59");
			List<BdzData> listYesterday = dcfsHsEmstimeDAO.getToday(map1);
			BdzData lastData;
			if(listYesterday == null || listYesterday.size() < 1) {
				lastData = dcfsHsEmstimeDAO.getMaxData(map1).get(0);
			} else {
				lastData = listYesterday.get(listYesterday.size() - 1);
			}
			for(int i=0; i < days; i++) {
				String hour = i < 10 ? "0" + i : "" + i;
				lastData.setDataTime(time + hour + ":00:00");
				full.add(lastData);
			}
		}else if(list.size() < days) {
			Date day = time == null ? new Date() :  new SimpleDateFormat("yyyy-MM-dd").parse(time);
			yesterday = DateUtils.formatDate(DateUtils.amount(day,Calendar.DAY_OF_YEAR,-1));
			HashMap map1=new HashMap();
			map1.put("code",map.get("code"));
			map1.put("startTime", yesterday+" 00:00:00");
			map1.put("endTime", yesterday+" 23:59:59");
			List<BdzData> listYesterday = dcfsHsEmstimeDAO.getToday(map1);
			*//*BdzData lastData = null;
			if(listYesterday == null || listYesterday.size() < 1) {
				lastData = dcfsHsEmstimeDAO.getMaxData(map1).get(0);
			} else {
				lastData = listYesterday.get(listYesterday.size() - 1);
			}
			BdzData minData = list.get(0);
			BdzData maxData = list.get(list.size() - 1);
			int min = Integer.parseInt(minData.getDataTime().substring(11, 13));
			int max = Integer.parseInt(maxData.getDataTime().substring(11, 13));
			for(int i=0; i < days; i++) {

				if(i < min) {
					String hour = i < 10 ? "0" + i : "" + i;
					lastData.setDataTime(time + hour + ":00:00");
					full.add(lastData);

				} else if( i > max) {
					String hour = i < 10 ? "0" + i : "" + i;
					maxData.setDataTime(time + hour + ":00:00");
					full.add(maxData);

				} else {
					BdzData temp = null;
					boolean b = true;
					for (BdzData bdzData : list) {
						String bdzDays = bdzData.getDataTime().substring(11, 13);
						int hourInt = Integer.parseInt(bdzDays);
						if(i == hourInt) {
							full.add(bdzData);
							b = false;
							break;
						}
					}
					if(b) {
						if(list.get(i - 1) != null) {
							temp = list.get(i - 1);
						}
						String hour = i < 10 ? "0" + i : "" + i;
						temp.setDataTime(time + hour + ":00:00");
						full.add(temp);
					}
				}
			}*//*
		} else {
			full = list;
		}*/
//		List<DcfsData> list=dcfsHsEmstimeDAO.getStatisticsDay(map);
		String str=getDatas(list, 1);
		getHttpServletResponse().setCharacterEncoding("utf-8");
	    getHttpServletResponse().setContentType("text/html:utf-8");
	    getHttpServletResponse().getWriter().print(str);
	}

	//示范站点周统计
	public void getStatisticsWeek() throws Exception{
		HashMap map=new HashMap();
		String bdzType = getHttpServletRequest().getParameter("typeWeek");
		if("1".equals(bdzType)){
			map.put("code", "02715071015_ESM100");
		} else if("2".equals(bdzType)){
			map.put("code", "02715071016_ESM100");
		} else if("3".equals(bdzType)){
			map.put("code", "02715071017_ESM100");
		} else {
			map.put("code", "13MT0227");
		}
		Calendar curr = Calendar.getInstance();
		curr.set(Calendar.DAY_OF_MONTH,curr.get(Calendar.DAY_OF_MONTH)-7);
		Date date=curr.getTime();
		map.put("startTime",date);
		map.put("endTime", new Date());
		List<BdzData> list=dcfsHsEmstimeDAO.getBdzWeek(map);
		List<BdzData> full= new ArrayList<>();
		int size = list.size();
		if(list == null || size < 7) {
			map.put("endTime", date);
			curr.set(Calendar.DAY_OF_MONTH,curr.get(Calendar.DAY_OF_MONTH)-7);
			map.put("startTime",curr.getTime());
			List<BdzData> list1=dcfsHsEmstimeDAO.getBdzWeek(map);
			if(list1 != null && list1.size() >= size) {
				for (int i = 7 - size; i > 0; i--) {
					full.add(list1.get(list1.size() - i));
				}
			}
		}
		full.addAll(list);
		/*List<BdzData> show= new ArrayList<BdzData>();
		for(int i =0 ;i < full.size();i ++) {
			if(i % 4 == 0) {
				show.add(full.get(i));
			}
		}*/
		String str=getDatas(full, 2);
		getHttpServletResponse().setCharacterEncoding("utf-8");
		getHttpServletResponse().setContentType("text/html:utf-8");
		getHttpServletResponse().getWriter().print(str);
	}

	//示范站点月统计
	public void getStatisticsMonth() throws Exception{
		SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy-MM");
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		HashMap map=new HashMap();
		String bdzType = getHttpServletRequest().getParameter("typeMonth");
		if("1".equals(bdzType)){
			map.put("code", "02715071015_ESM100");
		} else if("2".equals(bdzType)){
			map.put("code", "02715071016_ESM100");
		} else if("3".equals(bdzType)){
			map.put("code", "02715071017_ESM100");
		} else {
			map.put("code", "13MT0227");
		}
		if(time==null||"".equals(time)){
			Date dt = new Date();
			String str=sdf.format(dt);
			time=str.substring(0,str.length()-3);
		}
		Calendar rightNow = Calendar.getInstance();
		rightNow.setTime(simpleDate.parse(time));
		int days = rightNow.getActualMaximum(Calendar.DAY_OF_MONTH);//根据年月 获取月份天数
		map.put("startTime",sdf.parse(time+"-01"));
		map.put("endTime",sdf.parse(time+"-"+String.valueOf(days)));

		List<BdzData> list=dcfsHsEmstimeDAO.getBdzMonth(map);
		String str=getDatas(list, 3);
		getHttpServletResponse().setCharacterEncoding("utf-8");
		getHttpServletResponse().setContentType("text/html:utf-8");
		getHttpServletResponse().getWriter().print(str);
	}

	//示范点实时图走这个方法，已不用改
	private String getData(List<DcfsData> list){
		double[] value1=new double[list.size()];
		double[] value2=new double[list.size()];
		double[] value3=new double[list.size()];
		double[] value4=new double[list.size()];
		double[] value5=new double[list.size()];
		String[] x=new String[list.size()];
		for(int i=0;i<list.size();i++){
			value1[i]=list.get(i).getValue1();
			value2[i]=list.get(i).getValue2();
			value3[i]=list.get(i).getValue3();
			value4[i]=list.get(i).getValue4();
			value5[i]=list.get(i).getBatteryVoltage();
			x[i]=list.get(i).getDataTime();
		}

		StoreY storeY1=new StoreY();
		storeY1.setName("电场强度");
		StoreY storeY2=new StoreY();
		storeY2.setName("GMS900");
		StoreY storeY3=new StoreY();
		storeY3.setName("GMS1800");
		StoreY storeY4=new StoreY();
		storeY4.setName("UMTS 3G");
		StoreY storeY5=new StoreY();
		storeY5.setName("电磁电压");
		storeY1.setData(value1);
		storeY2.setData(value2);
		storeY3.setData(value3);
		storeY4.setData(value4);
		storeY5.setData(value5);
		storeY5.setVisible(false);
		List<StoreY> storeY = new ArrayList<>();
		storeY.add(storeY1);
		storeY.add(storeY2);
		storeY.add(storeY3);
		storeY.add(storeY4);
		storeY.add(storeY5);


		StoreX storeX=new StoreX();
		storeX.setCategories(x);
		Labels labels=new Labels();
		labels.setEnabled(false);
		storeX.setLabels(labels);
		Store store = new Store();
		store.setStoreY(storeY);
		store.setStoreX(storeX);
		return JsonUtils.toJsonString(store);
	}

	/**
	 * 数据统计 日，周，月 封装数据走此方法，只需完善横轴显示
	 * @param list
	 * @param periodType 1代表日报表，2代表周报表，3代表月报表
     * @return
     */
	public String getDatas(List<BdzData> list,int periodType){
		List<DetailY> electric_field = new ArrayList<>();//电场Y轴值集合
		List<DetailY> magnetic_field = new ArrayList<>();//磁场Y轴值集合
		String[] x=new String[list.size()];
		for(int i=0;i<list.size();i++){
			BdzData bdzData = list.get(i);

			DetailY detailY_ele = new DetailY();
			electric_field.add(detailY_ele);
			detailY_ele.setY(bdzData.getElectric_field());//电场，采用新的数据返回格式，便于封装折线去除点状的属性

			DetailY detailY_magnetic = new DetailY();
			magnetic_field.add(detailY_magnetic);
			detailY_magnetic.setY(bdzData.getMagnetic_field());//磁场

			//设置横轴显示的，TODO 改为时间
			if(periodType==2){//周
				x[i]=bdzData.getDataTime();
			}else if(periodType==3){//月
				x[i]=bdzData.getDataTime().substring(5,13) + "时";
			}else if(periodType==1){//日
				//x[i]=String.valueOf(i);
				if(bdzData.getDataTime()!=null) {
					String hr = bdzData.getDataTime().substring(11, 13);
					String mi = bdzData.getDataTime().substring(14, 16);
					try {
						int h = Integer.parseInt(hr);
						int m = Integer.parseInt(mi);
						x[i] = h + "时" + m + "分";
					} catch(Exception e) {
						x[i] = hr + "时" + mi + "分";
					}

				}
			}
		}

		StoreY2 storeY_ele = new StoreY2();
		storeY_ele.setName("电场强度");
		storeY_ele.setData(electric_field);

		StoreY2 storeY_magnetic = new StoreY2();
		storeY_magnetic.setName("磁场强度");
		storeY_magnetic.setData(magnetic_field);

		//返回前端的Y轴数据，用新类StoreY2，一个StoreY2代表一条线的所有Y轴数据
		List<StoreY2> series = new ArrayList<>();
		series.add(storeY_ele);
		series.add(storeY_magnetic);

		StoreX storeX=new StoreX();
		storeX.setCategories(x);

		Store2 store2 = new Store2();
		store2.setStoreY(series);//Y轴数据
		store2.setStoreX(storeX);//X轴数据
		store2.setPeriodType(periodType);//前台用于区分是哪种周期类型
		return JsonUtils.toJsonString(store2);
	}

	//下载excel数据
	public void downloadData() throws Exception{
		Map param = new HashMap();
		param.put("bdzCode", downloadBdzCode);
		String startTime = downloadBeginDay;
		param.put("startTime", startTime);
		String endTime = DateUtils.getNextDayDateStr(downloadEndDay);
		param.put("endTime", endTime);
		//下载数据类型 1分钟均值数据 2日均值数据
		List<BdzData> resultList = null;
		String templateName = "report_bdz";
		//宗关变电站(2016-06-12-2016-06-23)6分钟RMS数据
		String downloadFileName = BdzShiFanEnum.getBdzNameByBdzCode(downloadBdzCode)+"("+
				downloadBeginDay+"-"+downloadEndDay+")";
		String sheetName = "";
		if(dataType==1){
			resultList = dcfsHsEmstimeDAO.getMinuteReportData(param);
			downloadFileName += "5分钟数据";
			sheetName = "5分钟数据";
		}else if(dataType==2){
			resultList = dcfsHsEmstimeDAO.getHourReportData(param);
			downloadFileName += "小时数据";
			sheetName = "小时数据";
		}else if(dataType==3){
			resultList = dcfsHsEmstimeDAO.getDayReportData(param);
			downloadFileName += "日数据";
			sheetName = "日数据";
		}
		QueryResult<BdzData> queryResult = new QueryResult<>();
		queryResult.setResultlist(resultList);
		try {
			ExcelExporterUtils.exportExcelWithTemplate(queryResult, templateName, downloadFileName+".xls", sheetName,
					getHttpServletResponse(), getHttpServletRequest());
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		}
	}

	public DcfsHjjcdJbxx getDcfsHjjcdJbxx() {
		return dcfsHjjcdJbxx;
	}
	public void setDcfsHjjcdJbxx(DcfsHjjcdJbxx dcfsHjjcdJbxx) {
		this.dcfsHjjcdJbxx = dcfsHjjcdJbxx;
	}

	public DcfsHsEmstime getDcfsHsEmstime() {
		return dcfsHsEmstime;
	}

	public void setDcfsHsEmstime(DcfsHsEmstime dcfsHsEmstime) {
		this.dcfsHsEmstime = dcfsHsEmstime;
	}

	public String getChartJson() {
		return chartJson;
	}

	public void setChartJson(String chartJson) {
		this.chartJson = chartJson;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void setDataType(int dataType) {
		this.dataType = dataType;
	}

	public void setDownloadBdzCode(String downloadBdzCode) {
		this.downloadBdzCode = downloadBdzCode;
	}

	public void setDownloadBeginDay(String downloadBeginDay) {
		this.downloadBeginDay = downloadBeginDay;
	}

	public void setDownloadEndDay(String downloadEndDay) {
		this.downloadEndDay = downloadEndDay;
	}
}
